#include"process.h"
#include<unistd.h>

typedef void (*callback_t)(double total, double current);

double total = 256.0;  // 需要的下载量
double speed = 1.0;     // 下载速度

void DownLoad(callback_t cb)
{
	double current = 0;  // 当前下载量
	while(current < total)
	{
		usleep(30000);
		current += speed;
		cb(total,current);
	}
	printf("\n");
	printf("download %.2lfMB Done\n", total);
}

int main()
{
	DownLoad(FlushProcess);

	return 0;
}
